﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using VMDS.Business.Entities;
using VMDS.GUIClient.ServiceReference;


namespace VMDS.GUIClient.Model
{
    
    static class Repozitory
    {
        public static string VMplayerPath { get; set; }
        public static List<VM> OnlineVms { get; set; }
        public static List<VM> OfflineVms { get; set; }
        public static List<ScreenShot> ScreenShots { get; set; }
        public static bool AdmAvailable { get; set; }
        public static List<VM> GetVms()
        { 
            List<VM> result = new List<VM>();
            result.AddRange(OnlineVms);
            result.AddRange(OfflineVms);
            return result;
        }
        
        public static List<ScreenShot> GetScreenShots(VM vm)
        {
            if (ScreenShots != null)
                return ScreenShots.Where(screenShot => screenShot.VMId == vm.Id).ToList();
            else return null;

        }

        static Repozitory()
        {
            OfflineVms = new List<VM>();
            OnlineVms = new List<VM>();

        }
        
    }
}
